<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="x" uri="/WEB-INF/tags/coretag.tld" %>
<%@ taglib prefix="u" tagdir="/WEB-INF/tags" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <%@ include file="/WEB-INF/include/include.jsp" %>
  </head>
  <script type="text/javascript">
		function doLoad(){
			var form = Ext.getCmp("mainForm");
			form.reset();
			form.clearCondition();
			form.addCondition(new Condition('id',3));
			form.load({ waitMsg: '数据加载中...'});
		}
		function doSubmit(){
			var form = Ext.getCmp("mainForm");
			form.submit();
		}
		
		function afterLoadHandler(success,dataset,response, opts){
			var form = Ext.getCmp("mainForm").getForm();
			form.setValues(dataset.record[0]);
		}
		function afterSubmitHandler(result){
			var t=result;
		}
		
		
		
  </script>
  
  <body> 

 <div id="formPanelServerWrap"></div>
<div id="loadWrap"></div>
<div id="submitWrap"></div>
  <u:page>
  	<ui:formPanelServer id="mainForm" 
  		datasetName="MenuDataSetHandler"
  	 	handlerName="MenuQueryHandler" 
  	 	handlerMethod="queryOne" 
  	 	datasetMethod="save"
  	 	afterLoadHandler="afterLoadHandler" 
  	 	afterSubmitHandler="afterSubmitHandler"
  		renderTo="formPanelServerWrap">
  		<x:items>
  		  <ui:formPanel.text id="MENU_ID" fieldLabel="菜单编码"  ></ui:formPanel.text>
  		  <ui:formPanel.text id="MENU_NAME" fieldLabel="菜单名称"  ></ui:formPanel.text>
  		</x:items>
  	</ui:formPanelServer>
  	
  	<ui:button text="load" handler="doLoad" renderTo="loadWrap"></ui:button>
  	<ui:button text="submit" handler="doSubmit" renderTo="submitWrap"></ui:button>
  	
  </u:page>
  
  </body>
</html>
